<template>
  <div class="login" :style="bacpic">
    <div class="box">
      <div class="title">用户注册</div>
      <div class="ipt">
        <input type="text" placeholder="用户名" />
      </div>
      <div class="ipt">
        <input type="password" placeholder="密码" />
      </div>
      <div class="ipt">
        <input type="password" placeholder="重复密码" />
      </div>
      <div class="text">
        <span @click="goRegister">去登陆</span>
      </div>
      <div class="btn">
        <input type="button" value="注册" />
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import bac from "../assets/bac.png";
import { useRouter } from 'vue-router'
var $router = useRouter() ;

var bacpic = ref({
  backgroundImage: "url(" + bac + ")",
  backgroundRepeat: "no-repeat",
  backgroundSize: "cover",
  minHeight: "100vh",
  position: "relative",
  backgroundPosition: "center center",
});
var goRegister = ()=>{
  $router.push('/login')
}
</script>

<style scoped lang="scss">
.login {
  overflow: hidden;
  .box {
    width: 300px;
    margin: 200px auto;
    background-color: white;
    padding: 20px 40px 20px;
    .title {
      line-height: 30px;
    }
    .ipt {
      line-height: 40px;
      input {
        width: 100%;
        height: 30px;
        border: 1px solid #ccc;
        outline: none;
        border-radius: 5px;
        padding-left: 5px;
        color: #ccc;
        font-size: 12px;
      }
    }
    .text {
      line-height: 25px;
      font-size: 12px;
      color: lightskyblue;
      cursor: pointer;
    }
    .btn {
      margin: 30px auto;
      padding: 0 98px;
      input {
        padding: 5px 40px;
        border: none;
        background-color: rgb(55, 158, 243);
        border-radius: 40px;
        color: white;
        font-size: 12px;
        cursor: pointer;
      }
    }
  }
}
</style>